package cn.wenhe9.gulimall.sms.controller;

import cn.wenhe9.common.utils.ResultResponse;
import cn.wenhe9.gulimall.sms.service.SmsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author DuJinliang
 * 2022/4/14
 */
@RestController
@RequestMapping("/api/sms")
public class SmsController {

    @Resource
    private SmsService smsService;

    @PostMapping("/send/{phone}")
    public ResultResponse send(@PathVariable(name = "phone") String phone){
        smsService.send(phone);
        return ResultResponse.ok();
    }
}
